package hub.cathome.service.impl;

import hub.cathome.service.HashPassword;
import org.springframework.stereotype.Service;

@Service("hashPassword")
public class HashPasswordService implements HashPassword {
    @Override
    public Long createKey(String password) {
        char[] cs = password.toCharArray();
        long hashedPassword = 0;
        for(char c: cs){
            hashedPassword *= 10;
            hashedPassword += (long) ((int) c) *((int)c);
        }
        return hashedPassword;
    }

    @Override
    public Long createKey(long hashedPassword, int hashLength) {
        return null;
    }

}
